package com.example.syssoft.domain.proxy;

import com.example.syssoft.common.service.LogicService;
import com.example.syssoft.config.Result;
import com.example.syssoft.domain.Shop;
import com.example.syssoft.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.logging.Logger;


public class BusinessServiceProxy extends LogicService {

    @Resource
    private BusinessService businessService;

    public BusinessServiceProxy(@Autowired BusinessService businessService) {
        super(businessService.getDAO());
        this.businessService = businessService;
    }

    public Result addShop(Long businessId, Shop shop) {
        Logger.getLogger("BusinessServiceProxy").info(businessId.toString()+" "+shop.toString());
        Result result = businessService.addShop(businessId, shop);
        return result;
    }

    public Result getAllBusiness(int size, int page) {
        Logger.getLogger("BusinessServiceProxy").info("page="+page+" "+"size="+size);
        Result result = businessService.getAllBusiness(size, page);

        return result;
    }
}
